<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="__STATIC__/layui/css/layui.css">
    <link rel="stylesheet" href="__ADMIN__/main.css">
</head>
<body>
<div id="register">
    <form class="layui-form" method="post" action="doreg">
        <div class="layui-form-item">
            <label class="layui-form-label">用户名</label>
            <input class="layui-input layui-input-inline" type="text" name="Aname">
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">密码</label>
            <input class="layui-input layui-input-inline" type="password" name="Apassword">
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">验证码</label>
            <input class="layui-input layui-input-inline" type="text" name="captcha">
            <img id="refimg" src="{:captcha_src()}" alt="验证码">
        </div>
        <div id="button_group" class="layui-form-item">
            <input class="layui-btn layui-btn-primary" type="button" value="返回" onclick="window.history.back()">
            <input class="layui-btn" type="submit" value="提交">
        </div>
    </form>
</div>

<script src="__STATIC__/layui/layui.js"></script>
<script>
    layui.use('form', function () {
        var form = layui.form;
        //自定义验证规则
    });
    document.getElementById('refimg').onclick = ref;

    function ref() {
        var refimg = document.getElementById('refimg');
        refimg.src = "{:captcha_src()}";
    }
</script>
</body>
</html>